package com.me.backend.api.rest.resources;

import com.me.backend.api.domain.UserInfo;
import io.swagger.annotations.*;
import org.springframework.web.bind.annotation.*;

@Api(value = "Policy resource")
@RestController
public class PolicyResource {
    @CrossOrigin
    @RequestMapping(value = "/verify", method = RequestMethod.POST, produces = "application/json")
    @ApiOperation(value = "verify user info")
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "Success", response = Boolean.class)
    })
    public Boolean verify(@RequestBody UserInfo userInfo) {
        return "wenjie".equalsIgnoreCase(userInfo.getFirstName()) &&
                "chen".equalsIgnoreCase(userInfo.getLastName()) &&
                "123456".equalsIgnoreCase(userInfo.getPolicyNum());
    }
}
